package com.jinly.ryder.flow.web;

import com.jinly.ryder.flow.service.FlowRuleService;
import com.jinly.ryder.flow.web.mapping.FlowRuleVOMapping;
import com.jinly.ryder.flow.web.vo.FlowRuleVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("flow/rule")
@RequiredArgsConstructor
public class FlowRuleController {
    private final FlowRuleService flowRuleService;
    private final FlowRuleVOMapping flowRuleVOMapping;

    @GetMapping("list")
    public List<FlowRuleVO> flowRuleList() {
        return flowRuleVOMapping.toVoList(flowRuleService.flowRuleList());
    }
}
